package com.bank.config;

import cn.dev33.satoken.interceptor.SaRouteInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


import cn.dev33.satoken.interceptor.SaAnnotationInterceptor;


/**
 * [Sa-Token 权限认证] 配置类 
 * @author kong
 *
 */
@Configuration
public class SaTokenConfigure implements WebMvcConfigurer {

	// 注册拦截器
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 注册Sa-Token的路由拦截器，并排除登录接口或其他可匿名访问的接口地址 (与注解拦截器无关)
		registry.addInterceptor(new SaRouteInterceptor()).addPathPatterns("/**")

				.excludePathPatterns("/user/login")
		.excludePathPatterns("/swagger-ui/**","/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**");;
	}

}
